15. RAD Browsing



The CodeWarrior browser has additional capabilities for browsing rapid application development (RAD) projects. When you configure your project to generate a browser database, the IDE automatically includes additional RAD-specific information in the database. The browser displays a tab control in the Browser window to help you explore the additional information.

This chapter assumes that you are experienced with the general features of the browser, and that you want to learn how to use the browser's RAD capabilities. See "Browsing Source Code" on page 205 for more information about activating and configuring the browser for your project.

The topics in this chapter include:


Browser Window RAD Features

When exploring the browser database for RAD projects, the CodeWarrior browser enables additional functionality. This added functionality lets you use the following RAD capabilities:


Tab Control

The tab control is useful for browsing a RAD component's supporting items, such as properties, methods, and events.

The tab control displays one view at a time. Click a tab name to display its associated view. For example, click the Java tab in Figure 15.1 to display the Java view. This particular view shows Java RAD information for the selected component in the Classes pane.

Figure 15.1 The Browser window for a Java RAD project


When you click a Properties, Methods, or Events tab, the corresponding view only displays information for public data not inherited from other member functions. In such views, both the Browser Access Filters pop-up menu and the Show Inherited checkbox are grayed out, indicating that you cannot change these settings. Figure 15.2, Figure 15.3, and Figure 15.4 show the resulting Browser window.


Properties View

The Properties view, shown in Figure 15.2, displays information about the properties of the selected component in the Classes pane. This view is divided into the Properties pane and the Implementation pane.

Figure 15.2 Browsing properties


The Properties pane lists the properties for the selected component. When you select a property in this list, the implementation for that property is shown in the Implementation pane. To learn how to create new properties, see "New Property Window" on page 564.

The Implementation pane is similar to the Source pane. This pane displays the selected property's implementation in your source code. The source code in the pane is fully editable. The top of the pane shows the path to the file containing the implementation.


Methods View

The Methods view, shown in Figure 15.3, displays information about the methods of the selected component in the Classes pane. This tab view is divided into the Methods pane and the Implementation pane.

Figure 15.3 Browsing methods


The Methods pane lists the methods for the selected component. When you select a method in this list, the implementation for that method is shown in the Implementation pane. To learn how to create new methods, see "New Method Window" on page 566.

The Implementation pane is similar to the Source pane. This pane displays the selected method's implementation in your source code. The source code in the pane is fully editable. The top of the pane shows the path to the file containing the implementation.


Events View

The Events view, shown in Figure 15.4, displays information about the events of the selected component in the Classes pane. This tab view is divided into the Event Sets pane and the Events pane.

Figure 15.4 Browsing event sets and events


The Event Sets pane lists groupings of events for the selected component. The Events pane shows the individual events for a selected event set. To learn how to create new event sets, see "New Event Set Window" on page 569. To learn how to create new events, refer to "New Event Window" on page 577.


RAD Windows

When you create a new property, method, event set, or event for a component in your RAD project, the IDE displays a window to assist you. Different options are available for each window type. This section describes the following windows:


New Property Window

The New Property window helps you create a new property for a selected component in the Browser window. To display this window, make sure that the Browser window is frontmost, then choose New Property from the Browser menu. Alternatively, click the new item icon (), as shown in Figure 15.2 on page 561. The New Property command changes slightly, based on the framework you use to develop your code. For example, when developing a Java RAD project, the command changes to New Bean Property.

The New Property window is shown in Figure 15.5. This window consists of the following parts:


Name

Enter a name for the new property in this field. The name you enter must comply with naming conventions in the framework programming language. For example, you cannot use spaces in names for some languages.


Type

Enter an appropriate property type in this field. The type you specify must be a valid property type in the framework language.


Package required for type

If you wish, you can enter in this field a required package for the property type.

Figure 15.5 New Property window



Accessors

These checkboxes determine the accessor characteristics for the property.


Has Data Member

Enable this checkbox if you want the property to have a data member. If you enable the checkbox, the Name and Initializer fields become available, as well as the Transient and Volatile checkboxes. Enter the data member name in the Name field. You can supply the remaining information as desired.


Summary

This section shows you a synopsis of the information currently specified in the window. As you change a particular value or checkbox, the Summary field updates to reflect your changes. This field displays information only after you complete the Name and Type fields and enable at least one of the Accessors.


Add and Cancel buttons

Click Add to confirm the current window information and add the new property, or click Cancel to discard your changes.


New Method Window

The New Method window helps you create a new method for a selected component in the Browser window. To display this window, make sure that the Browser window is frontmost, then choose New Method from the Browser menu. Alternatively, click the new item icon (), as shown in Figure 15.3 on page 562. The New Method command changes slightly, based on the framework you use to develop your code. For example, when developing a Java RAD project, the command changes to New Bean Method.

The New Method window is shown in Figure 15.6. This window consists of the following parts:


Name

Enter a name for the new method in this field. The name you enter must comply with naming conventions in the framework programming language. For example, you cannot use spaces in names for some languages.


Return type

Enter an appropriate method return type in this field. The type you specify must be a valid return type in the framework language.


Parameters

If desired, enter method parameters in this field. Some example parameters are listed above this field.


Optional throws

If desired, enter exception-handling information (throws) in this field. Some example throws are listed above this field.


Package required for parameters

If you wish, you can enter in this field a required package for the parameter. Some example packages are listed above this field.

Figure 15.6 New Method window



Modifiers

Use the Access and Specifier pop-up menus to choose the access level and method specifier for the new method. Possible access levels include Public, Protected, and Private. Possible specifiers include None, Abstract, Final, and Static. You can enable the Native or Synchronized checkboxes as desired to further describe the method's modifiers.


Declaration

This section shows you the current form of the declaration as specified in the window. After you change a particular value or checkbox, the Declaration field updates to reflect your changes. This field displays information only after you complete the Name and Type fields and specify an Access level.


Add and Cancel buttons

Click Add to confirm the current window information and add the new method, or click Cancel to discard your changes.


New Event Set Window

The New Event Set window helps you create a new event set for a selected component in the Browser window. To display this window, make sure that the Browser window is frontmost, then choose New Event Set from the Browser menu. Alternatively, click the new item icon (), as shown in Figure 15.4 on page 563. The New Event Set command changes slightly, based on the framework you use to develop your code. For example, when developing a Java RAD project, the command changes to New Bean Event Set. The New Event Set window is shown in Figure 15.7.

Figure 15.7 New Event Set window


This window lets you specify the type of event set you want to create. There are two possibilities:


New Custom Event Set

When you enable this option and click OK, a wizard opens to help you create a custom event set. See "New Event Set wizard" on page 571 for more information.


Existing Custom Set

When you enable this option and click OK, the Existing Event Set window, shown in Figure 15.8, displays. Select from the list the event set you wish to add and click Add. This existing event set is then added to the selected component in the Browser window.

Figure 15.8 Adding an existing event set



New Event Set wizard

The New Event Set Window contains an option to create a New Custom Event Set. When you enable this option and click OK, the New Event Set wizard displays.

The wizard includes the following navigation buttons:

The New Event Set wizard is divided into the following steps:

1. Choose a name and location for the new event set.

2. Specify a base class and a list of implementations.

3. Assign the new event set to the project's build targets.

You progress through these steps in sequence. Each step builds on the information provided in previous steps. When you supply enough information in a particular step, click Next to continue.

To accept all current settings in the wizard and quickly create a new event set, click Finish. The wizard displays a summary of all the current settings for the new event set. You can always click Cancel while viewing the summary to continue modifying settings.

To use the New Event Set wizard, follow these steps:

1. Choose a name and location for the new event set.

This section of the wizard, shown in Figure 15.9, lets you specify the name and location of the new event set, as well as the modifiers for the set.

This section includes the following parts:

  • Class Name
  • File
  • Package
  • Modifiers

  • Class Name

    Enter a name for the event set's class in this field. An example is provided below the field. The Class is a Bean checkbox below the field remains disabled. This status indicates that you are not creating a Java bean.

    Figure 15.9 New Event Set wizard - Name and Location



    File

    This pop-up menu lets you specify the type of event set:

    Depending on the option you choose, different fields become enabled below the File pop-up menu. The enabled fields for the New File option are shown in Figure 15.9, and the enabled fields for the Relative to class option are shown in Figure 15.10.

    If you choose the New File option, type in the enabled field the path to which you want to save the file. Alternatively, click Set next to the field. A standard Save window opens. Use the window controls to select the location to which you want to save the file and click Save.

    Figure 15.10 Choosing the Relative to class option


    If you choose the Relative to class option, the class field and the pop-up menu beside it become enabled, as shown in Figure 15.10. In the class field, type the name of the class you want to relate to the event set. Alternatively, click Set next to the class field, select a class in the window that opens, and then click Select. Next, use the pop-up menu to place the event set event set Before, After, or Inside the specified class.


    Package

    If you wish, you can enter in this field a package for the event set. This field is not available if you choose the Relative to class option from the File pop-up menu.


    Modifiers

    Use the Access and Specifier pop-up menus to choose the access level and method specifier for the new event set. Possible access levels include Public, Protected, and Private. Possible specifiers include None, Abstract, Final, and Static.

    2. Specify a base class and a list of implementations.

    This section of the wizard, shown in Figure 15.11, lets you specify the base class and implementations for the new event set.

    Figure 15.11 New Event Set wizard - Base Class and Interfaces


    This section includes the following parts:


    Base Class

    The settings in this part determine the base-class type of the new event set. There are two possibilities:


    Implements List

    In this part, type a list of interfaces to be implemented by the base class. Example interfaces are provided. Separate multiple interfaces with commas.

    3. Assign the new event set to the project's build targets.

    This section of the wizard, shown in Figure 15.12, lets you assign the event set to particular build targets within the active project.

    Figure 15.12 New Event Set wizard - Targets


    To assign the event set to a specific build target, enable the checkbox next to the build target's name in the Add file to targets list. For example, in Figure 15.12, the new event set is assigned to the JavaApp Debug build target, and it is not assigned to JavaApp Release.


    New Event Window

    The New Event window helps you create a new event for a selected event set in the Browser window. To display this window, make sure that the Browser window is frontmost and that an event set is selected, then choose New Event from the Browser menu. Alternatively, click the icon described in the Events pane, shown in Figure 15.4 on page 563. The New Event command changes slightly, based on the framework you use to develop your code. For example, when developing a Java RAD project, the command changes to New Bean Event.

    The New Event Set window is shown in Figure 15.13. This window consists of the following parts:


    Name

    Enter a name for the new method in this field. The name you enter must comply with naming conventions in the framework programming language. For example, you cannot use spaces in names for some languages.


    Parameters

    If desired, enter event parameters in this field. A sample construct for a parameter is listed above this field.


    Optional throws

    If desired, enter exception-handling information (throws) in this field.

    Figure 15.13 New Event window



    Package required for parameters

    If you wish, you can enter in this field a required package for the event.


    Modifiers

    Enable the Synchronized checkbox to modify the event accordingly.


    Declaration

    This section shows you the current form of the declaration as specified in the window. After you change a particular value or checkbox, the Declaration field updates to reflect your changes. This field displays information only after you complete the Name field.


    Add and Cancel buttons

    Click Add to confirm the current window information and add the new method, or click Cancel to discard your changes.





    Visit the Metrowerks website at: http://www.metrowerks.com
    For assistance contact Metrowerks Technical Support at: support@metrowerks.com
    Copyright © 1999, Metrowerks Corp. All rights reserved.

    Last updated: May 24, 1999 * Chris Magnuson * John Roseborough